home *** CD-ROM | disk | FTP | other *** search
- 10 DATA 76,93,88,69,100,75,84,999
- 20 READ NUM:IF NUM=999 THEN GOTO 100 'get a number, check if last number
- 30 COUNT=COUNT+1 'count the number of numbers
- 40 SUM=SUM+NUM 'find the sum of the numbers
- 50 GOTO 20 'get the next number
- 100 PRINT "The sum of the";COUNT;"numbers is";SUM
- 110 PRINT "and the average is";SUM/COUNT
- 'get the next n